import { MockMethod } from 'vite-plugin-mock'
import { user } from './helper/data'
import { Random } from 'mockjs'

export default [
  {
    url: '/api/user/info',
    method: 'get',
    response: () => {
      return {
        code: 200,
        message: '请求成功',
        status: 'success',
        data: user,
      }
    },
  },
  {
    url: '/api/user/login',
    method: 'post',
    response: () => {
      return {
        code: 0,
        msg: 'success',
        data: {
          token: Random.string(20),
          uid: Random.string(10),
          username: 'admin'
        }
      }
    }
  },
] as MockMethod[]
